Skip to main content

SnapshotComponent

SnapshotComponent API

SnapshotComponent.doActivate
SnapshotComponent.doActivate(): void

Implements doActivate method.

Returns
void
SnapshotComponent.createSnapshot
SnapshotComponent.createSnapshot(userDrawCallback: (ctx: CanvasRenderingContext2D) => void): Promise<Blob>

Creates a snapshot of the canvas and returns it as a Promise of Blob object.

Parameters
userDrawCallback: (ctx: CanvasRenderingContext2D) => void
- Optional callback function that takes a CanvasRenderingContext2D object as a parameter and allows the user to draw on the canvas before taking the snapshot.
Returns
Promise<Blob>
;